<template>
    <el-form label-suffix=":" v-loading="loading" :model="formData" :rules="editable ? formRules : {}" ref="formRef"
        label-width="140px">
        <vp-card>
            <template #header>
                <vp-label zh="基础信息" en="Basic Information" />
            </template>
            <el-row>
                <vp-col :span="3">
                    <el-form-item prop="wllx">
                        <template #label><vp-label zh="物料类型" en="Material Cat." /></template>
                        <el-radio-group v-model="formData.wllx" class="radio-group" @change="handleChangeWllx"
                            :disabled="type != 'add'">
                            <el-radio :label="10"><vp-label zh="航材" en="Aircraft Material"></vp-label> </el-radio>
                            <el-radio :label="20"><vp-label zh="化工品" en="Chemical"></vp-label></el-radio>
                            <el-radio :label="30"><vp-label zh="工具" en="Tool"></vp-label></el-radio>
                        </el-radio-group>
                    </el-form-item>
                </vp-col>
                <vp-col :span="3">
                    <el-form-item prop="ejlx" v-if="formData.wllx === 10">
                        <template #label><vp-label zh="航材类型" en="Aircraft Material Type" /></template>
                        <el-radio-group v-if="editable" v-model="formData.ejlx" class="radio-group">
                            <el-radio :label="10"><vp-label zh="消耗件" en="Consumable"></vp-label></el-radio>
                            <el-radio :label="20"><vp-label zh="周转件" en="Rotable"></vp-label></el-radio>
                        </el-radio-group>
                    </el-form-item>
                    <el-form-item prop="ejlx" v-if="formData.wllx === 30">
                        <template #label><vp-label zh="航材类型" en="Aircraft Material Type" /></template>
                        <el-select v-if="editable" v-model="formData.ejlx" placeholder="请选择" clearable>
                            <el-option label="专用工具" :value="10"></el-option>
                            <el-option label="通用工具" :value="20"></el-option>
                            <el-option label="专用设备" :value="30"></el-option>
                            <el-option label="通用设备" :value="40"></el-option>
                        </el-select>
                    </el-form-item>
                </vp-col>
            </el-row>
            <el-row>
                <vp-col :span="4">
                    <el-form-item prop="jh">
                        <template #label>
                            <vp-label v-if="formData.wllx === 10" zh="件号" en="P/N" />
                            <vp-label v-if="formData.wllx === 20" zh="产品名(编码)" en="Product Name" />
                            <vp-label v-if="formData.wllx === 30 && formData.ejlx!==10" zh="厂家编码" en="P/N" />
                            <vp-label v-if="formData.wllx === 30 && formData.ejlx===10" zh="物料编码" en="Tool No." />
                        </template>
                        <el-input v-if="editable" v-model="formData.jh" maxlength="100" :disabled="formData.wllx === 30 && formData.ejlx==10" />
                        <span v-else>{{ formData.jh }}</span>
                    </el-form-item>
                </vp-col>
                <vp-col :span="4">
                    <el-form-item prop="ywms">
                        <template #label><vp-label zh="英文名称" en="EN Desc." /></template>
                        <el-input v-if="editable" v-model="formData.ywms" maxlength="100" />
                        <span v-else>{{ formData.ywms }}</span>
                    </el-form-item>
                </vp-col>
                <vp-col :span="4">
                    <el-form-item prop="zwms">
                        <template #label><vp-label zh="中文名称" en="CN Desc." /></template>
                        <el-input v-if="editable" v-model="formData.zwms" maxlength="100" />
                        <span v-else>{{ formData.zwms }}</span>
                    </el-form-item>
                </vp-col>
                <vp-col :span="4">
                    <el-form-item prop="jldw">
                        <template #label><vp-label zh="单位" en="Unit" /></template>
                        <VpDictSelect :lxid="401" :selectedId="formData.jldw"
                            @dictSelected="obj => { formData.jldw = obj; }" style="width:100%" v-if="editable">
                        </VpDictSelect>
                        <span v-else>{{ formData.jldw }}</span>
                    </el-form-item>
                </vp-col>
            </el-row>
            <el-row>
                <vp-col :span="4">
                    <el-form-item prop="ly">
                        <template #label>
                            <vp-label v-if="formData.wllx === 10" zh="件号来源" en="Sourse" />
                            <vp-label v-if="formData.wllx === 20" zh="产品来源" en="Sourse" />
                            <vp-label v-if="formData.wllx === 30" zh="工具来源" en="Sourse" />
                        </template>
                        <VpDictSelect :lxid="402" :selectedId="formData.ly"
                            @dictSelected="obj => { formData.ly = obj; }" style="width:100%" v-if="editable">
                        </VpDictSelect>
                        <span v-else>{{ formData.ly }}</span>
                    </el-form-item>
                </vp-col>
                <vp-col :span="4">
                    <el-form-item prop="lysm">
                        <template #label><vp-label zh="来源说明" en="Sourse Desc." /></template>
                        <el-input v-if="editable" v-model="formData.lysm" maxlength="100" />
                        <span v-else>{{ formData.lysm }}</span>
                    </el-form-item>
                </vp-col>
                <vp-col :span="4" v-if="formData.wllx !== 30">
                    <el-form-item prop="syjx">
                        <template #label><vp-label zh="适用机型" en="Applicable AC Type" /></template>
                        <BasedataModelSelectAllDialog ref="basedataModelMultAllDialog" @selected="basedataModelSelectAllConfirm" v-if="editable">
                        </BasedataModelSelectAllDialog>
                        <span v-else>{{ formData.syjxText }}</span>
                    </el-form-item>
                </vp-col>
                <vp-col :span="4" v-if="formData.wllx === 10">
                    <el-form-item prop="ata">
                        <template #label><vp-label zh="ATA" en="ATA" /></template>
                        <BasedataAtaSelect v-model="formData.ata" v-if="editable"></BasedataAtaSelect>
                        <BasedataAtaLink v-else :selectId="formData.ata" />
                    </el-form-item>
                </vp-col>
            </el-row>

            <el-row>
                <vp-col :span="4" v-if="formData.wllx === 10">
                    <el-form-item prop="xingh">
                        <template #label><vp-label zh="型号" en="Model" /></template>
                        <el-input v-if="editable" v-model="formData.xingh" maxlength="100" />
                        <span v-else>{{ formData.xingh }}</span>
                    </el-form-item>
                </vp-col>
                <vp-col :span="4" v-if="formData.wllx === 20">
                    <el-form-item prop="gg">
                        <template #label><vp-label zh="规格" en="Specification" /></template>
                        <el-input v-if="editable" v-model="formData.gg" maxlength="100" />
                        <span v-else>{{ formData.gg }}</span>
                    </el-form-item>
                </vp-col>
                <vp-col :span="4" v-if="formData.wllx === 20">
                    <el-form-item prop="biaoz">
                        <template #label><vp-label zh="标准" en="Standard" /></template>
                        <el-input v-if="editable" v-model="formData.biaoz" maxlength="100" />
                        <span v-else>{{ formData.biaoz }}</span>
                    </el-form-item>
                </vp-col>

                <vp-col :span="4" v-if="formData.wllx === 10">
                    <el-form-item prop="yzjbs">
                        <template #label><vp-label zh="是否有⼆级⼦部件" en="Sub-part" /></template>
                        <el-radio-group v-model="formData.yzjbs" class="radio-group" :disabled="!editable">
                            <el-radio :label="10">是</el-radio>
                            <el-radio :label="20">否</el-radio>
                        </el-radio-group>
                    </el-form-item>
                </vp-col>

                <vp-col :span="4" v-if="formData.wllx === 10">
                    <el-form-item prop="jrchjlbs">
                        <template #label><vp-label zh="进⼊拆换记录" en="Include in Replacement Record" /></template>
                        <el-radio-group v-model="formData.jrchjlbs" class="radio-group" @change="handleChanageJrchjlbs"
                            :disabled="!editable">
                            <el-radio :label="10">是</el-radio>
                            <el-radio :label="20">否</el-radio>
                        </el-radio-group>
                    </el-form-item>
                </vp-col>
                <vp-col :span="4" v-if="formData.wllx === 20">
                    <el-form-item prop="wxpbs">
                        <template #label><vp-label zh="危险品标识" en="" /></template>
                        <el-radio-group v-model="formData.wxpbs" class="radio-group" :disabled="!editable">
                            <el-radio :label="10">是</el-radio>
                            <el-radio :label="20">否</el-radio>
                        </el-radio-group>
                    </el-form-item>
                </vp-col>
                <vp-col :span="4" v-if="formData.wllx !== 30">
                    <el-form-item prop="zzcj">
                        <template #label><vp-label zh="制造厂家" en="Manufacturer" /></template>
                        <el-input v-if="editable" v-model="formData.zzcj" maxlength="100" />
                        <span v-else>{{ formData.zzcj }}</span>
                    </el-form-item>
                </vp-col>
            </el-row>


            <el-row>
                <vp-col :span="2" v-if="formData.wllx === 10">
                    <el-form-item prop="gjjbs">
                        <template #label><vp-label zh="关键部件" en="Key Part Type" /></template>
                        <el-radio-group v-model="formData.gjjbs" class="radio-group" :disabled="!editable">
                            <el-radio :label="10">是</el-radio>
                            <el-radio :label="20">否</el-radio>
                        </el-radio-group>
                    </el-form-item>
                </vp-col>
                <vp-col :span="2" v-if="formData.wllx === 10 && formData.gjjbs === 10">
                    <el-form-item prop="gjbjlx">
                        <template #label><vp-label zh="关键部件类型" en="Key Part Type" /></template>
                        <el-select v-if="editable" v-model="formData.gjbjlx" placeholder="请选择" clearable>
                            <el-option label="发动机" :value="20"><vp-label zh="发动机" en="Engine"></vp-label></el-option>
                            <el-option label="螺旋桨" :value="40"><vp-label zh="螺旋桨" en="Propeller"></vp-label></el-option>
                            <el-option label="起落架" :value="50"><vp-label zh="起落架"
                                    en="Landing Gear"></vp-label></el-option>
                        </el-select>
                        <span v-else>{{
                            formData.gjbjlx === 20 ? '发动机/Engine' : formData.gjbjlx === 40 ? '螺旋桨/Propeller' :
                                formData.gjbjlx === 50 ? '起落架/Landing Gear' : ""
                        }}</span>
                    </el-form-item>
                </vp-col>
            </el-row>

            <el-row>
                <vp-col :span="3" v-if="formData.wllx === 30">
                    <el-form-item prop="jlgjbs">
                        <template #label><vp-label zh="计量工具" en="Instrument" /></template>
                        <el-radio-group v-model="formData.jlgjbs" class="radio-group" :disabled="!editable">
                            <el-radio :label="10">是</el-radio>
                            <el-radio :label="20">否</el-radio>
                        </el-radio-group>
                    </el-form-item>
                </vp-col>
                <vp-col :span="3" v-if="formData.wllx === 30">
                    <el-form-item prop="lc">
                        <template #label><vp-label zh="量程" en="Range" /></template>
                        <el-input v-if="editable" v-model="formData.lc" maxlength="100" />
                        <span v-else>{{ formData.lc }}</span>
                    </el-form-item>
                </vp-col>
                <vp-col :span="3" v-if="formData.wllx === 30">
                    <el-form-item prop="jingd">
                        <template #label><vp-label zh="精度" en="Precision" /></template>
                        <el-input v-if="editable" v-model="formData.jingd" maxlength="100" />
                        <span v-else>{{ formData.jingd }}</span>
                    </el-form-item>
                </vp-col>
            </el-row>
            <el-row>
                <vp-col :span="1">
                    <el-form-item prop="bz">
                        <template #label><vp-label zh="备注" en="Remark" /></template>
                        <el-input v-if="editable" type="textarea" v-model="formData.bz" maxlength="1000" />
                        <span v-else style="white-space:pre">{{ formData.bz }}</span>
                    </el-form-item>
                </vp-col>
            </el-row>
        </vp-card>

        <vp-card>
            <template #header>
                <vp-label zh="库管信息" en="Inventory Info." />
            </template>
            <el-row>
                <vp-col :span="3">
                    <el-form-item prop="gljb">
                        <template #label><vp-label zh="管理级别" en="Management Level" /></template>
                        <el-select v-if="editable" v-model="formData.gljb" placeholder="请选择" clearable>
                            <el-option label="序列号管理" :value="10"></el-option>
                            <el-option label="批次号管理" :value="20"></el-option>
                        </el-select>
                        <span v-else>{{ formData.gljb === 10 ? "序列号管理" : formData.gljb === 20 ? "批次号管理" : '' }}</span>
                    </el-form-item>
                </vp-col>
                <vp-col :span="3">
                    <el-form-item prop="jyckid">
                        <template #label><vp-label zh="建议仓库" en="Suggested Warehouse" /></template>
                        <VpWarehouseSelect v-model="formData.jyckid" ref="vpWarehouseSelectRef" v-if="editable">
                        </VpWarehouseSelect>
                        <span v-else>{{ formData.jyckName }}</span>
                    </el-form-item>
                </vp-col>
                <vp-col :span="3">
                    <el-form-item prop="jykwid" v-if="formData.jyckid">
                        <template #label><vp-label zh="建议库位" en="Suggested Location" /></template>
                        <VpWarehouseLocationSelect v-model="formData.jykwid" v-if="editable"
                            :warehouseId="formData.jyckid" />
                        <span v-else>{{ formData.jykwName }}</span>
                    </el-form-item>
                </vp-col>
            </el-row>


            <el-row v-if="formData.wllx === 10">
                <vp-col :span="3">
                    <el-form-item prop="hcjz" v-if="formData.wllx === 10">
                        <template #label><vp-label zh="航材价值" en="" /></template>
                        <VpDictSelect :lxid="403" :selectedId="formData.hcjz"
                            @dictSelected="obj => { formData.hcjz = obj; }" style="width:100%" v-if="editable">
                        </VpDictSelect>
                        <span v-else>{{ formData.hcjz }}</span>
                    </el-form-item>
                </vp-col>
                <vp-col :span="3" v-if="formData.wllx === 10">
                    <el-form-item prop="ltfdbs">
                        <template #label><vp-label zh="轮胎翻动" en="Tire Rotation" /></template>
                        <el-radio-group v-model="formData.ltfdbs" class="radio-group" :disabled="!editable">
                            <el-radio :label="10">是</el-radio>
                            <el-radio :label="20">否</el-radio>
                        </el-radio-group>
                    </el-form-item>
                </vp-col>
                <vp-col :span="3" v-if="formData.wllx === 10">
                    <el-form-item prop="dpcdbs">
                        <template #label><vp-label zh="电瓶充电" en="Battery Charge" /></template>
                        <el-radio-group v-model="formData.dpcdbs" class="radio-group" :disabled="!editable">
                            <el-radio :label="10">是</el-radio>
                            <el-radio :label="20">否</el-radio>
                        </el-radio-group>
                    </el-form-item>
                </vp-col>
            </el-row>

            <el-row v-if="formData.wllx === 20">
                <vp-col :span="3">
                    <el-form-item prop="ccwd" v-if="formData.wllx === 20">
                        <template #label><vp-label zh="存储温度" en="Storage Temperature" /></template>
                        <el-input v-if="editable" v-model="formData.ccwd" maxlength="100" />
                        <span v-else>{{ formData.ccwd }}</span>
                    </el-form-item>
                </vp-col>
                <vp-col :span="3">
                    <el-form-item prop="sd" v-if="formData.wllx === 20">
                        <template #label><vp-label zh="闪点" en="Flash Point" /></template>
                        <el-input v-if="editable" v-model="formData.sd" maxlength="100" />
                        <span v-else>{{ formData.sd }}</span>
                    </el-form-item>
                </vp-col>
            </el-row>

            <el-row>
                <vp-col :span="1">
                    <el-form-item>
                        <template #label><vp-label zh="库存安全存量设置" en="Safety Stock Setting" /></template>
                        <vp-vxe-table :data="formData.storageLimitList" row-key="id" minHeight="300">
                            <vxe-column field="ckBh">
                                <template #header><vp-label zh="仓库编号" en="Warehouse No." /></template>
                                <template #default="scope">
                                    <el-form-item :prop="`storageLimitList[${scope.rowIndex}].ckid`" label-width="auto">
                                        <VpWarehouseSelect v-model="formData.storageLimitList[scope.rowIndex].ckid" ref="vpWarehouseSelectRef"
                                            v-if="editable"
                                            @selected-items="(selectedItem) => handleChooseWarehouse(scope.rowIndex, selectedItem)">
                                        </VpWarehouseSelect>
                                        <span v-else>{{ scope.row.ckBh }}</span>
                                    </el-form-item>
                                </template>
                            </vxe-column>
                            <vxe-column field="ckName">
                                <template #header><vp-label zh="仓库名称" en="Warehouse Name" /></template>
                                <template #default="scope">
                                    <el-form-item :prop="`storageLimitList[${scope.rowIndex}].ckName`"
                                        label-width="auto">
                                        <span>{{ scope.row.ckName }}</span>
                                    </el-form-item>
                                </template>
                            </vxe-column>
                            <vxe-column field="bh">
                                <template #header><vp-label zh="最低库存" en="Min Stock" /></template>
                                <template #default="scope">
                                    <el-form-item :prop="`storageLimitList[${scope.rowIndex}].zdkc`" label-width="auto">
                                        <el-input-number v-model="scope.row.zdkc" :min="0" :max="999999"
                                            v-if="editable" />
                                        <span v-else>{{ scope.row.zdkc }}</span>
                                    </el-form-item>
                                </template>
                            </vxe-column>
                            <vxe-column field="bh">
                                <template #header><vp-label zh="最高库存" en="Max Stock" /></template>
                                <template #default="scope">
                                    <el-form-item :prop="`storageLimitList[${scope.rowIndex}].zgkc`" label-width="auto">
                                        <el-input-number v-model="scope.row.zgkc" :min="1" :max="999999"
                                            v-if="editable" />
                                        <span v-else>{{ scope.row.zgkc }}</span>
                                    </el-form-item>
                                </template>
                            </vxe-column>
                            <vxe-column align="center" width="100" v-if="editable">
                                <template #header>
                                    <el-button circle @click="handleAddStorageLimit()">
                                        <SvgIcon name="ele-Plus"></SvgIcon>
                                    </el-button>
                                </template>
                                <template #default="scope">
                                    <el-button circle @click="handleDeleteStorageLimit(scope.rowIndex)">
                                        <SvgIcon name="ele-Minus"></SvgIcon>
                                    </el-button>
                                </template>
                            </vxe-column>
                        </vp-vxe-table>
                    </el-form-item>
                </vp-col>
            </el-row>

            <el-row>
                <vp-col :span="1">
                    <el-form-item prop="attachment">
                        <template #label><vp-label zh="照片" en="" /></template>
                        <VpImageSigleUpload v-model="formData.attachment" :disabled="!(editable)" />
                    </el-form-item>
                </vp-col>
            </el-row>
        </vp-card>


    </el-form>
</template>
<script setup lang="ts" name="material">
import { computed, onMounted, defineAsyncComponent, ref } from 'vue'
import validateUtils from '/@/utils/validateUtils';

import VpDictSelect from '/@/components/vp/dict/VpDictSelect.vue';
import VpImageSigleUpload from '/@/components/vp/image/VpImageSigleUpload.vue';
import BasedataModelSelectAllDialog from '/@/components/vp/basedata/basedataModelSelectAllDialog.vue';
import BasedataAtaSelect from '/@/components/vp/basedataAta/basedataAtaSelect.vue';
import BasedataAtaLink from '/@/components/vp/basedataAta/basedataAtaLink.vue';

const VpWarehouseSelect = defineAsyncComponent(() => import('/@/components/vp/warehouse/VpWarehouseSelect.vue'));
const VpWarehouseLocationSelect = defineAsyncComponent(() => import('/@/components/vp/warehouse/VpWarehouseLocationSelect.vue'));

const props = defineProps({
    // 页面类型
    type: {
        type: String,
        default: 'add',
    },
    // 加载状态
    loading: {
        type: Boolean,
        default: false,
    },
    // 开启验证
    enableValid: {
        type: Boolean,
        default: true,
    }
});

const formData = ref({
    id: "",
    qyzt: 10,
    wllx: 10,
    ejlx: null,
    jh: "",
    zwms: "",
    ywms: "",
    jldw: "",
    ly: "",
    lysm: "",
    syjx: null as number | null,
    ata: "",
    xingh: "",
    gg: "",
    biaoz: "",
    zzcj: "",
    yzjbs: null,
    jrchjlbs: null,
    wxpbs: null,
    gjjbs: null,
    gjbjlx: null,

    jlgjbs: null,
    lc: null,
    jingd: null,

    bz: null,
    gljb: null as number | null,
    //建议仓库
    jyckid: "",
    jyckName: "",
    jykwid: "",
    jykwName: "",

    attachment: null,



    hcjz: "",
    ltfdbs: null as number | null,
    dpcdbs: null as number | null,

    ccwd: "",
    sd: "",

    actypeList: [] as any,
    storageLimitList: [] as any,

    zpglid: "",

    syjxText: "",
});

const formRules = {
    wllx: [validateUtils.notNull],
    ejlx: [validateUtils.notNull],
    jh: [{
        message: '必填/Required.',
        validator: (rule: any, value: any, callback: any) => {
            if ((formData.value.wllx !== 30 || formData.value.ejlx!==10) && !formData.value.lc) {
                callback(new Error());
            } else {
                callback();
            }
        },
    }],
    ywms: [validateUtils.notNull],
    jldw: [validateUtils.notNull],
    ly: [validateUtils.notNull],
    gg: [validateUtils.notNull],
    biaoz: [validateUtils.notNull],
    yzjbs: [validateUtils.notNull],
    jrchjlbs: [validateUtils.notNull],
    gjjbs: [validateUtils.notNull],
    gljb: [validateUtils.notNull],
    ltfdbs: [validateUtils.notNull],
    dpcdbs: [validateUtils.notNull],

    lc: [{
        message: '必填/Required.',
        validator: (rule: any, value: any, callback: any) => {
            if (formData.value.jlgjbs == 10 && !formData.value.lc) {
                callback(new Error());
            } else {
                callback();
            }
        },
    }],
}

const initFormData = () => {
    formData.value = {
        id: "",
        qyzt: 10,
        wllx: 10,
        ejlx: null,
        jh: "",
        zwms: "",
        ywms: "",
        jldw: "",
        ly: "",
        lysm: "",
        syjx: null,
        ata: "",
        xingh: "",
        gg: "",
        biaoz: "",
        zzcj: "",
        yzjbs: null,
        jrchjlbs: null,
        wxpbs: null,
        gjjbs: null,
        gjbjlx: null,

        jlgjbs: null,
        lc: null,
        jingd: null,

        bz: null,
        gljb: null,
        jyckid: "",
        jyckName: "",
        jykwid: "",
        jykwName: "",

        hcjz: "",
        ltfdbs: null,
        dpcdbs: null,

        ccwd: "",
        sd: "",

        attachment: null,


        actypeList: [] as any,
        storageLimitList: [] as any,

        zpglid: "",

        syjxText: ""
    }
}

const editable = computed(() => {
    return props.type === 'add' || props.type === 'edit';
})


const formRef = ref();

// 回显数据
const setData = (data: any) => {
    initFormData();
    formData.value = {
        ...formData.value,
        ...data,
    };
}

/**
 * 获取数据
 */
const getData = (zt: number): Promise<any> => {
    return new Promise((resolve, reject) => {
        if (zt === 10 || !props.enableValid) {
            resolve(formData.value);
        }
        formRef.value.validate((valid: boolean) => {
            if (valid) {
                resolve(formData.value);
            } else {
                reject();
            }
        })
    })
}

//库存安全存量设置
const handleAddStorageLimit = () => {
    formData.value.storageLimitList.push({
        id: "",
        mainid: "",
        xc: "",
        ckid: "",
        ckName: "",
        zdkc: "",
        zgkc: ""
    });
}
const handleDeleteStorageLimit = (index: number) => {
    formData.value.storageLimitList.splice(index, 1);
}


const handleChooseWarehouse = (rowIndex: number, selectedItem: any) => {
    if (!selectedItem) {
        formData.value.storageLimitList[rowIndex].ckid = '';
        formData.value.storageLimitList[rowIndex].ckBh = '';
        formData.value.storageLimitList[rowIndex].ckName = '';
        return;
    }
    formData.value.storageLimitList[rowIndex].ckid = selectedItem.id;
    formData.value.storageLimitList[rowIndex].ckBh = selectedItem.bh;
    formData.value.storageLimitList[rowIndex].ckName = selectedItem.mc;
}

const handleChanageJrchjlbs = (e: any) => {
    console.log("e", e);
    if (e == 10) {
        formData.value.gljb = 10;
        formData.value.ltfdbs = 20;
        formData.value.dpcdbs = 20;
    }
}
const handleChangeWllx = (e: any) => {
    if (e === 20) {
        formData.value.gljb = 20;
    }
}


const basedataModelMultAllDialog = ref();
const basedataModelSelectAllConfirm = (data: any) => {
    if (data.all) {
        formData.value.syjx = 10;

        formData.value.syjxText = "ALL";
    } else {
        formData.value.syjx = 20;
        formData.value.actypeList = data.data.map((item: any) => item.jx);
        formData.value.syjxText = formData.value.actypeList.join(",");
    }
}

defineExpose({
    setData,
    getData,
})
</script>